﻿using System;
using System.Web;
using NHibernate.Engine;
using NHibernate.Id;

namespace Library
{
    public class SequenceGenerator : TableGenerator
    {
        private const Int32 SeedValue = 20;        
        
        public override object Generate(ISessionImplementor session, object obj)
        {
            //
            //HttpContext.Current.Application["Sequence." + obj.GetType().Name];
            int counter = Convert.ToInt32(base.Generate(session, obj));
            return counter + SeedValue + 1;
        }
    }
}
